package drds.binlog.protocol.entry_protocol_proto;

/**
 * <pre>
 * *message Header*
 * </pre>
 * <p>
 * Protobuf type {@code com.alibaba.otter.canal.protocol.Header}
 */
public final class Header extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Header)
        HeaderOrBuilder
{
    public static final int VERSION_FIELD_NUMBER = 1;
    public static final int LOGFILENAME_FIELD_NUMBER = 2;
    public static final int LOGFILEOFFSET_FIELD_NUMBER = 3;
    public static final int SERVERID_FIELD_NUMBER = 4;
    public static final int SERVERENCODE_FIELD_NUMBER = 5;
    public static final int EXECUTETIME_FIELD_NUMBER = 6;
    public static final int SOURCETYPE_FIELD_NUMBER = 7;
    public static final int SCHEMANAME_FIELD_NUMBER = 8;
    public static final int TABLENAME_FIELD_NUMBER = 9;
    public static final int EVENTLENGTH_FIELD_NUMBER = 10;
    public static final int EVENTTYPE_FIELD_NUMBER = 11;

    ;
    public static final int PROPS_FIELD_NUMBER = 12;
    public static final int GTID_FIELD_NUMBER = 13;
    private static final long serialVersionUID = 0L;
    // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header)
    private static final Header DEFAULT_INSTANCE;

    ;
    private static final com.google.protobuf.Parser<Header>
            PARSER = new com.google.protobuf.AbstractParser<Header>()
    {
        @Override
        public Header parsePartialFrom(
                com.google.protobuf.CodedInputStream input,
                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                throws com.google.protobuf.InvalidProtocolBufferException
        {
            return new Header(input, extensionRegistry);
        }
    };

    static
    {
        DEFAULT_INSTANCE = new Header();
    }

    private int bitField0_;
    private int versionPresentCase_ = 0;

    ;
    private Object versionPresent_;
    private int sourceTypePresentCase_ = 0;
    private Object sourceTypePresent_;
    private int eventTypePresentCase_ = 0;
    private Object eventTypePresent_;
    private volatile Object logfileName_;
    private long logfileOffset_;
    private long serverId_;
    private volatile Object serverenCode_;
    private long executeTime_;
    private volatile Object schemaName_;
    private volatile Object tableName_;
    private long eventLength_;
    private java.util.List<Pair> props_;
    private volatile Object gtid_;
    private byte memoizedIsInitialized = -1;

    // Use Header.newBuilder() to construct.
    private Header(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
    {
        super(builder);
    }

    private Header()
    {
        logfileName_ = "";
        logfileOffset_ = 0L;
        serverId_ = 0L;
        serverenCode_ = "";
        executeTime_ = 0L;
        schemaName_ = "";
        tableName_ = "";
        eventLength_ = 0L;
        props_ = java.util.Collections.emptyList();
        gtid_ = "";
    }

    private Header(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        this();
        if (extensionRegistry == null)
        {
            throw new NullPointerException();
        }
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
                com.google.protobuf.UnknownFieldSet.newBuilder();
        try
        {
            boolean done = false;
            while (!done)
            {
                int tag = input.readTag();
                switch (tag)
                {
                    case 0:
                        done = true;
                        break;
                    case 8:
                    {
                        versionPresentCase_ = 1;
                        versionPresent_ = input.readInt32();
                        break;
                    }
                    case 18:
                    {
                        String s = input.readStringRequireUtf8();

                        logfileName_ = s;
                        break;
                    }
                    case 24:
                    {

                        logfileOffset_ = input.readInt64();
                        break;
                    }
                    case 32:
                    {

                        serverId_ = input.readInt64();
                        break;
                    }
                    case 42:
                    {
                        String s = input.readStringRequireUtf8();

                        serverenCode_ = s;
                        break;
                    }
                    case 48:
                    {

                        executeTime_ = input.readInt64();
                        break;
                    }
                    case 56:
                    {
                        int rawValue = input.readEnum();
                        sourceTypePresentCase_ = 7;
                        sourceTypePresent_ = rawValue;
                        break;
                    }
                    case 66:
                    {
                        String s = input.readStringRequireUtf8();

                        schemaName_ = s;
                        break;
                    }
                    case 74:
                    {
                        String s = input.readStringRequireUtf8();

                        tableName_ = s;
                        break;
                    }
                    case 80:
                    {

                        eventLength_ = input.readInt64();
                        break;
                    }
                    case 88:
                    {
                        int rawValue = input.readEnum();
                        eventTypePresentCase_ = 11;
                        eventTypePresent_ = rawValue;
                        break;
                    }
                    case 98:
                    {
                        if (!((mutable_bitField0_ & 0x00000800) == 0x00000800))
                        {
                            props_ = new java.util.ArrayList<Pair>();
                            mutable_bitField0_ |= 0x00000800;
                        }
                        props_.add(
                                input.readMessage(Pair.parser(), extensionRegistry));
                        break;
                    }
                    case 106:
                    {
                        String s = input.readStringRequireUtf8();

                        gtid_ = s;
                        break;
                    }
                    default:
                    {
                        if (!parseUnknownFieldProto3(
                                input, unknownFields, extensionRegistry, tag))
                        {
                            done = true;
                        }
                        break;
                    }
                }
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e)
        {
            throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e)
        {
            throw new com.google.protobuf.InvalidProtocolBufferException(
                    e).setUnfinishedMessage(this);
        } finally
        {
            if (((mutable_bitField0_ & 0x00000800) == 0x00000800))
            {
                props_ = java.util.Collections.unmodifiableList(props_);
            }
            this.unknownFields = unknownFields.build();
            makeExtensionsImmutable();
        }
    }

    public static final com.google.protobuf.Descriptors.Descriptor
    getDescriptor()
    {
        return BinlogEntry.protocol_Header_descriptor;
    }

    public static Header parseFrom(
            java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(
            java.nio.ByteBuffer data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(
            com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(byte[] data)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(
            byte[] data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException
    {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(java.io.InputStream input)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseWithIOException(PARSER, input);
    }

    public static Header parseFrom(
            java.io.InputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static Header parseDelimitedFrom(java.io.InputStream input)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseDelimitedWithIOException(PARSER, input);
    }

    public static Header parseDelimitedFrom(
            java.io.InputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }

    public static Header parseFrom(
            com.google.protobuf.CodedInputStream input)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseWithIOException(PARSER, input);
    }

    public static Header parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException
    {
        return com.google.protobuf.GeneratedMessageV3
                .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static Builder newBuilder()
    {
        return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(Header prototype)
    {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    public static Header getDefaultInstance()
    {
        return DEFAULT_INSTANCE;
    }

    public static com.google.protobuf.Parser<Header> parser()
    {
        return PARSER;
    }

    @Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields()
    {
        return this.unknownFields;
    }

    @Override
    protected FieldAccessorTable
    internalGetFieldAccessorTable()
    {
        return BinlogEntry.protocol_Header_fieldAccessorTable
                .ensureFieldAccessorsInitialized(
                        Header.class, Builder.class);
    }

    public VersionPresentCase
    getVersionPresentCase()
    {
        return VersionPresentCase.forNumber(
                versionPresentCase_);
    }

    public SourceTypePresentCase
    getSourceTypePresentCase()
    {
        return SourceTypePresentCase.forNumber(
                sourceTypePresentCase_);
    }

    public EventTypePresentCase
    getEventTypePresentCase()
    {
        return EventTypePresentCase.forNumber(
                eventTypePresentCase_);
    }

    /**
     * <code>int32 version = 1;</code>
     */
    public int getVersion()
    {
        if (versionPresentCase_ == 1)
        {
            return (Integer) versionPresent_;
        }
        return 1;
    }

    /**
     * <pre>
     * *binlog/redolog 文件名*
     * </pre>
     * <p>
     * <code>string logfileName = 2;</code>
     */
    public String getLogfileName()
    {
        Object ref = logfileName_;
        if (ref instanceof String)
        {
            return (String) ref;
        } else
        {
            com.google.protobuf.ByteString bs =
                    (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            logfileName_ = s;
            return s;
        }
    }

    /**
     * <pre>
     * *binlog/redolog 文件名*
     * </pre>
     * <p>
     * <code>string logfileName = 2;</code>
     */
    public com.google.protobuf.ByteString
    getLogfileNameBytes()
    {
        Object ref = logfileName_;
        if (ref instanceof String)
        {
            com.google.protobuf.ByteString b =
                    com.google.protobuf.ByteString.copyFromUtf8(
                            (String) ref);
            logfileName_ = b;
            return b;
        } else
        {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    /**
     * <pre>
     * *binlog/redolog 文件的偏移位置*
     * </pre>
     * <p>
     * <code>int64 logfileOffset = 3;</code>
     */
    public long getLogfileOffset()
    {
        return logfileOffset_;
    }

    /**
     * <pre>
     * *服务端serverId*
     * </pre>
     * <p>
     * <code>int64 serverId = 4;</code>
     */
    public long getServerId()
    {
        return serverId_;
    }

    /**
     * <pre>
     * * 变更数据的编码 *
     * </pre>
     * <p>
     * <code>string serverenCode = 5;</code>
     */
    public String getServerenCode()
    {
        Object ref = serverenCode_;
        if (ref instanceof String)
        {
            return (String) ref;
        } else
        {
            com.google.protobuf.ByteString bs =
                    (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            serverenCode_ = s;
            return s;
        }
    }

    /**
     * <pre>
     * * 变更数据的编码 *
     * </pre>
     * <p>
     * <code>string serverenCode = 5;</code>
     */
    public com.google.protobuf.ByteString
    getServerenCodeBytes()
    {
        Object ref = serverenCode_;
        if (ref instanceof String)
        {
            com.google.protobuf.ByteString b =
                    com.google.protobuf.ByteString.copyFromUtf8(
                            (String) ref);
            serverenCode_ = b;
            return b;
        } else
        {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    /**
     * <pre>
     * *变更数据的执行时间 *
     * </pre>
     * <p>
     * <code>int64 executeTime = 6;</code>
     */
    public long getExecuteTime()
    {
        return executeTime_;
    }

    /**
     * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
     */
    public int getSourceTypeValue()
    {
        if (sourceTypePresentCase_ == 7)
        {
            return (Integer) sourceTypePresent_;
        }
        return 0;
    }

    /**
     * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
     */
    public Type getSourceType()
    {
        if (sourceTypePresentCase_ == 7)
        {
            @SuppressWarnings("deprecation")
            Type result = Type.valueOf(
                    (Integer) sourceTypePresent_);
            return result == null ? Type.UNRECOGNIZED : result;
        }
        return Type.TYPECOMPATIBLEPROTO2;
    }

    /**
     * <pre>
     * * 变更数据的schemaname*
     * </pre>
     * <p>
     * <code>string schemaName = 8;</code>
     */
    public String getSchemaName()
    {
        Object ref = schemaName_;
        if (ref instanceof String)
        {
            return (String) ref;
        } else
        {
            com.google.protobuf.ByteString bs =
                    (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            schemaName_ = s;
            return s;
        }
    }

    /**
     * <pre>
     * * 变更数据的schemaname*
     * </pre>
     * <p>
     * <code>string schemaName = 8;</code>
     */
    public com.google.protobuf.ByteString
    getSchemaNameBytes()
    {
        Object ref = schemaName_;
        if (ref instanceof String)
        {
            com.google.protobuf.ByteString b =
                    com.google.protobuf.ByteString.copyFromUtf8(
                            (String) ref);
            schemaName_ = b;
            return b;
        } else
        {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    /**
     * <pre>
     * *变更数据的tablename*
     * </pre>
     * <p>
     * <code>string tableName = 9;</code>
     */
    public String getTableName()
    {
        Object ref = tableName_;
        if (ref instanceof String)
        {
            return (String) ref;
        } else
        {
            com.google.protobuf.ByteString bs =
                    (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            tableName_ = s;
            return s;
        }
    }

    /**
     * <pre>
     * *变更数据的tablename*
     * </pre>
     * <p>
     * <code>string tableName = 9;</code>
     */
    public com.google.protobuf.ByteString
    getTableNameBytes()
    {
        Object ref = tableName_;
        if (ref instanceof String)
        {
            com.google.protobuf.ByteString b =
                    com.google.protobuf.ByteString.copyFromUtf8(
                            (String) ref);
            tableName_ = b;
            return b;
        } else
        {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    /**
     * <pre>
     * *每个event的长度*
     * </pre>
     * <p>
     * <code>int64 eventLength = 10;</code>
     */
    public long getEventLength()
    {
        return eventLength_;
    }

    /**
     * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
     */
    public int getEventTypeValue()
    {
        if (eventTypePresentCase_ == 11)
        {
            return (Integer) eventTypePresent_;
        }
        return 0;
    }

    /**
     * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
     */
    public EventType getEventType()
    {
        if (eventTypePresentCase_ == 11)
        {
            @SuppressWarnings("deprecation")
            EventType result = EventType.valueOf(
                    (Integer) eventTypePresent_);
            return result == null ? EventType.UNRECOGNIZED : result;
        }
        return EventType.EVENTTYPECOMPATIBLEPROTO2;
    }

    /**
     * <pre>
     * *预留扩展*
     * </pre>
     * <p>
     * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
     */
    public java.util.List<Pair> getPropsList()
    {
        return props_;
    }

    /**
     * <pre>
     * *预留扩展*
     * </pre>
     * <p>
     * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
     */
    public java.util.List<? extends PairOrBuilder>
    getPropsOrBuilderList()
    {
        return props_;
    }

    /**
     * <pre>
     * *预留扩展*
     * </pre>
     * <p>
     * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
     */
    public int getPropsCount()
    {
        return props_.size();
    }

    /**
     * <pre>
     * *预留扩展*
     * </pre>
     * <p>
     * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
     */
    public Pair getProps(int index)
    {
        return props_.get(index);
    }

    /**
     * <pre>
     * *预留扩展*
     * </pre>
     * <p>
     * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
     */
    public PairOrBuilder getPropsOrBuilder(
            int index)
    {
        return props_.get(index);
    }

    /**
     * <pre>
     * *当前事务的gitd*
     * </pre>
     * <p>
     * <code>string gtid = 13;</code>
     */
    public String getGtid()
    {
        Object ref = gtid_;
        if (ref instanceof String)
        {
            return (String) ref;
        } else
        {
            com.google.protobuf.ByteString bs =
                    (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            gtid_ = s;
            return s;
        }
    }

    /**
     * <pre>
     * *当前事务的gitd*
     * </pre>
     * <p>
     * <code>string gtid = 13;</code>
     */
    public com.google.protobuf.ByteString
    getGtidBytes()
    {
        Object ref = gtid_;
        if (ref instanceof String)
        {
            com.google.protobuf.ByteString b =
                    com.google.protobuf.ByteString.copyFromUtf8(
                            (String) ref);
            gtid_ = b;
            return b;
        } else
        {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    @Override
    public final boolean isInitialized()
    {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;

        memoizedIsInitialized = 1;
        return true;
    }

    @Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
            throws java.io.IOException
    {
        if (versionPresentCase_ == 1)
        {
            output.writeInt32(
                    1, (int) ((Integer) versionPresent_));
        }
        if (!getLogfileNameBytes().isEmpty())
        {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logfileName_);
        }
        if (logfileOffset_ != 0L)
        {
            output.writeInt64(3, logfileOffset_);
        }
        if (serverId_ != 0L)
        {
            output.writeInt64(4, serverId_);
        }
        if (!getServerenCodeBytes().isEmpty())
        {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serverenCode_);
        }
        if (executeTime_ != 0L)
        {
            output.writeInt64(6, executeTime_);
        }
        if (sourceTypePresentCase_ == 7)
        {
            output.writeEnum(7, ((Integer) sourceTypePresent_));
        }
        if (!getSchemaNameBytes().isEmpty())
        {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 8, schemaName_);
        }
        if (!getTableNameBytes().isEmpty())
        {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 9, tableName_);
        }
        if (eventLength_ != 0L)
        {
            output.writeInt64(10, eventLength_);
        }
        if (eventTypePresentCase_ == 11)
        {
            output.writeEnum(11, ((Integer) eventTypePresent_));
        }
        for (int i = 0; i < props_.size(); i++)
        {
            output.writeMessage(12, props_.get(i));
        }
        if (!getGtidBytes().isEmpty())
        {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gtid_);
        }
        unknownFields.writeTo(output);
    }

    @Override
    public int getSerializedSize()
    {
        int size = memoizedSize;
        if (size != -1) return size;

        size = 0;
        if (versionPresentCase_ == 1)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeInt32Size(
                            1, (int) ((Integer) versionPresent_));
        }
        if (!getLogfileNameBytes().isEmpty())
        {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logfileName_);
        }
        if (logfileOffset_ != 0L)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeInt64Size(3, logfileOffset_);
        }
        if (serverId_ != 0L)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeInt64Size(4, serverId_);
        }
        if (!getServerenCodeBytes().isEmpty())
        {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serverenCode_);
        }
        if (executeTime_ != 0L)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeInt64Size(6, executeTime_);
        }
        if (sourceTypePresentCase_ == 7)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeEnumSize(7, ((Integer) sourceTypePresent_));
        }
        if (!getSchemaNameBytes().isEmpty())
        {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, schemaName_);
        }
        if (!getTableNameBytes().isEmpty())
        {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, tableName_);
        }
        if (eventLength_ != 0L)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeInt64Size(10, eventLength_);
        }
        if (eventTypePresentCase_ == 11)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeEnumSize(11, ((Integer) eventTypePresent_));
        }
        for (int i = 0; i < props_.size(); i++)
        {
            size += com.google.protobuf.CodedOutputStream
                    .computeMessageSize(12, props_.get(i));
        }
        if (!getGtidBytes().isEmpty())
        {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gtid_);
        }
        size += unknownFields.getSerializedSize();
        memoizedSize = size;
        return size;
    }

    @Override
    public boolean equals(final Object obj)
    {
        if (obj == this)
        {
            return true;
        }
        if (!(obj instanceof Header))
        {
            return super.equals(obj);
        }
        Header other = (Header) obj;

        boolean result = true;
        result = result && getLogfileName()
                .equals(other.getLogfileName());
        result = result && (getLogfileOffset()
                == other.getLogfileOffset());
        result = result && (getServerId()
                == other.getServerId());
        result = result && getServerenCode()
                .equals(other.getServerenCode());
        result = result && (getExecuteTime()
                == other.getExecuteTime());
        result = result && getSchemaName()
                .equals(other.getSchemaName());
        result = result && getTableName()
                .equals(other.getTableName());
        result = result && (getEventLength()
                == other.getEventLength());
        result = result && getPropsList()
                .equals(other.getPropsList());
        result = result && getGtid()
                .equals(other.getGtid());
        result = result && getVersionPresentCase().equals(
                other.getVersionPresentCase());
        if (!result) return false;
        switch (versionPresentCase_)
        {
            case 1:
                result = result && (getVersion()
                        == other.getVersion());
                break;
            case 0:
            default:
        }
        result = result && getSourceTypePresentCase().equals(
                other.getSourceTypePresentCase());
        if (!result) return false;
        switch (sourceTypePresentCase_)
        {
            case 7:
                result = result && getSourceTypeValue()
                        == other.getSourceTypeValue();
                break;
            case 0:
            default:
        }
        result = result && getEventTypePresentCase().equals(
                other.getEventTypePresentCase());
        if (!result) return false;
        switch (eventTypePresentCase_)
        {
            case 11:
                result = result && getEventTypeValue()
                        == other.getEventTypeValue();
                break;
            case 0:
            default:
        }
        result = result && unknownFields.equals(other.unknownFields);
        return result;
    }

    @Override
    public int hashCode()
    {
        if (memoizedHashCode != 0)
        {
            return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        hash = (37 * hash) + LOGFILENAME_FIELD_NUMBER;
        hash = (53 * hash) + getLogfileName().hashCode();
        hash = (37 * hash) + LOGFILEOFFSET_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
                getLogfileOffset());
        hash = (37 * hash) + SERVERID_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
                getServerId());
        hash = (37 * hash) + SERVERENCODE_FIELD_NUMBER;
        hash = (53 * hash) + getServerenCode().hashCode();
        hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
                getExecuteTime());
        hash = (37 * hash) + SCHEMANAME_FIELD_NUMBER;
        hash = (53 * hash) + getSchemaName().hashCode();
        hash = (37 * hash) + TABLENAME_FIELD_NUMBER;
        hash = (53 * hash) + getTableName().hashCode();
        hash = (37 * hash) + EVENTLENGTH_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
                getEventLength());
        if (getPropsCount() > 0)
        {
            hash = (37 * hash) + PROPS_FIELD_NUMBER;
            hash = (53 * hash) + getPropsList().hashCode();
        }
        hash = (37 * hash) + GTID_FIELD_NUMBER;
        hash = (53 * hash) + getGtid().hashCode();
        switch (versionPresentCase_)
        {
            case 1:
                hash = (37 * hash) + VERSION_FIELD_NUMBER;
                hash = (53 * hash) + getVersion();
                break;
            case 0:
            default:
        }
        switch (sourceTypePresentCase_)
        {
            case 7:
                hash = (37 * hash) + SOURCETYPE_FIELD_NUMBER;
                hash = (53 * hash) + getSourceTypeValue();
                break;
            case 0:
            default:
        }
        switch (eventTypePresentCase_)
        {
            case 11:
                hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER;
                hash = (53 * hash) + getEventTypeValue();
                break;
            case 0:
            default:
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
    }

    @Override
    public Builder newBuilderForType()
    {
        return newBuilder();
    }

    @Override
    public Builder toBuilder()
    {
        return this == DEFAULT_INSTANCE
                ? new Builder() : new Builder().mergeFrom(this);
    }

    @Override
    protected Builder newBuilderForType(
            BuilderParent parent)
    {
        Builder builder = new Builder(parent);
        return builder;
    }

    @Override
    public com.google.protobuf.Parser<Header> getParserForType()
    {
        return PARSER;
    }

    @Override
    public Header getDefaultInstanceForType()
    {
        return DEFAULT_INSTANCE;
    }

    public enum VersionPresentCase
            implements com.google.protobuf.Internal.EnumLite
    {
        VERSION(1),
        VERSIONPRESENT_NOT_SET(0);
        private final int value;

        private VersionPresentCase(int value)
        {
            this.value = value;
        }

        /**
         * @deprecated Use {@link #forNumber(int)} instead.
         */
        @Deprecated
        public static VersionPresentCase valueOf(int value)
        {
            return forNumber(value);
        }

        public static VersionPresentCase forNumber(int value)
        {
            switch (value)
            {
                case 1:
                    return VERSION;
                case 0:
                    return VERSIONPRESENT_NOT_SET;
                default:
                    return null;
            }
        }

        public int getNumber()
        {
            return this.value;
        }
    }

    public enum SourceTypePresentCase
            implements com.google.protobuf.Internal.EnumLite
    {
        SOURCETYPE(7),
        SOURCETYPEPRESENT_NOT_SET(0);
        private final int value;

        private SourceTypePresentCase(int value)
        {
            this.value = value;
        }

        /**
         * @deprecated Use {@link #forNumber(int)} instead.
         */
        @Deprecated
        public static SourceTypePresentCase valueOf(int value)
        {
            return forNumber(value);
        }

        public static SourceTypePresentCase forNumber(int value)
        {
            switch (value)
            {
                case 7:
                    return SOURCETYPE;
                case 0:
                    return SOURCETYPEPRESENT_NOT_SET;
                default:
                    return null;
            }
        }

        public int getNumber()
        {
            return this.value;
        }
    }

    public enum EventTypePresentCase
            implements com.google.protobuf.Internal.EnumLite
    {
        EVENTTYPE(11),
        EVENTTYPEPRESENT_NOT_SET(0);
        private final int value;

        private EventTypePresentCase(int value)
        {
            this.value = value;
        }

        /**
         * @deprecated Use {@link #forNumber(int)} instead.
         */
        @Deprecated
        public static EventTypePresentCase valueOf(int value)
        {
            return forNumber(value);
        }

        public static EventTypePresentCase forNumber(int value)
        {
            switch (value)
            {
                case 11:
                    return EVENTTYPE;
                case 0:
                    return EVENTTYPEPRESENT_NOT_SET;
                default:
                    return null;
            }
        }

        public int getNumber()
        {
            return this.value;
        }
    }

    /**
     * <pre>
     * *message Header*
     * </pre>
     * <p>
     * Protobuf type {@code com.alibaba.otter.canal.protocol.Header}
     */
    public static final class Builder extends
            com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
            // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Header)
            HeaderOrBuilder
    {
        private int versionPresentCase_ = 0;
        private Object versionPresent_;
        private int sourceTypePresentCase_ = 0;
        private Object sourceTypePresent_;
        private int eventTypePresentCase_ = 0;
        private Object eventTypePresent_;
        private int bitField0_;
        private Object logfileName_ = "";
        private long logfileOffset_;
        private long serverId_;
        private Object serverenCode_ = "";
        private long executeTime_;
        private Object schemaName_ = "";
        private Object tableName_ = "";
        private long eventLength_;
        private java.util.List<Pair> props_ =
                java.util.Collections.emptyList();
        private com.google.protobuf.RepeatedFieldBuilderV3<
                Pair, Pair.Builder, PairOrBuilder> propsBuilder_;
        private Object gtid_ = "";

        // Construct using BinlogEntry.Header.newBuilder()
        private Builder()
        {
            maybeForceBuilderInitialization();
        }

        private Builder(
                BuilderParent parent)
        {
            super(parent);
            maybeForceBuilderInitialization();
        }

        public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor()
        {
            return BinlogEntry.protocol_Header_descriptor;
        }

        @Override
        protected FieldAccessorTable
        internalGetFieldAccessorTable()
        {
            return BinlogEntry.protocol_Header_fieldAccessorTable
                    .ensureFieldAccessorsInitialized(
                            Header.class, Builder.class);
        }

        private void maybeForceBuilderInitialization()
        {
            if (com.google.protobuf.GeneratedMessageV3
                    .alwaysUseFieldBuilders)
            {
                getPropsFieldBuilder();
            }
        }

        @Override
        public Builder clear()
        {
            super.clear();
            logfileName_ = "";

            logfileOffset_ = 0L;

            serverId_ = 0L;

            serverenCode_ = "";

            executeTime_ = 0L;

            schemaName_ = "";

            tableName_ = "";

            eventLength_ = 0L;

            if (propsBuilder_ == null)
            {
                props_ = java.util.Collections.emptyList();
                bitField0_ = (bitField0_ & ~0x00000800);
            } else
            {
                propsBuilder_.clear();
            }
            gtid_ = "";

            versionPresentCase_ = 0;
            versionPresent_ = null;
            sourceTypePresentCase_ = 0;
            sourceTypePresent_ = null;
            eventTypePresentCase_ = 0;
            eventTypePresent_ = null;
            return this;
        }

        @Override
        public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType()
        {
            return BinlogEntry.protocol_Header_descriptor;
        }

        @Override
        public Header getDefaultInstanceForType()
        {
            return Header.getDefaultInstance();
        }

        @Override
        public Header build()
        {
            Header result = buildPartial();
            if (!result.isInitialized())
            {
                throw newUninitializedMessageException(result);
            }
            return result;
        }

        @Override
        public Header buildPartial()
        {
            Header result = new Header(this);
            int from_bitField0_ = bitField0_;
            int to_bitField0_ = 0;
            if (versionPresentCase_ == 1)
            {
                result.versionPresent_ = versionPresent_;
            }
            result.logfileName_ = logfileName_;
            result.logfileOffset_ = logfileOffset_;
            result.serverId_ = serverId_;
            result.serverenCode_ = serverenCode_;
            result.executeTime_ = executeTime_;
            if (sourceTypePresentCase_ == 7)
            {
                result.sourceTypePresent_ = sourceTypePresent_;
            }
            result.schemaName_ = schemaName_;
            result.tableName_ = tableName_;
            result.eventLength_ = eventLength_;
            if (eventTypePresentCase_ == 11)
            {
                result.eventTypePresent_ = eventTypePresent_;
            }
            if (propsBuilder_ == null)
            {
                if (((bitField0_ & 0x00000800) == 0x00000800))
                {
                    props_ = java.util.Collections.unmodifiableList(props_);
                    bitField0_ = (bitField0_ & ~0x00000800);
                }
                result.props_ = props_;
            } else
            {
                result.props_ = propsBuilder_.build();
            }
            result.gtid_ = gtid_;
            result.bitField0_ = to_bitField0_;
            result.versionPresentCase_ = versionPresentCase_;
            result.sourceTypePresentCase_ = sourceTypePresentCase_;
            result.eventTypePresentCase_ = eventTypePresentCase_;
            onBuilt();
            return result;
        }

        @Override
        public Builder clone()
        {
            return (Builder) super.clone();
        }

        @Override
        public Builder setField(
                com.google.protobuf.Descriptors.FieldDescriptor field,
                Object value)
        {
            return (Builder) super.setField(field, value);
        }

        @Override
        public Builder clearField(
                com.google.protobuf.Descriptors.FieldDescriptor field)
        {
            return (Builder) super.clearField(field);
        }

        @Override
        public Builder clearOneof(
                com.google.protobuf.Descriptors.OneofDescriptor oneof)
        {
            return (Builder) super.clearOneof(oneof);
        }

        @Override
        public Builder setRepeatedField(
                com.google.protobuf.Descriptors.FieldDescriptor field,
                int index, Object value)
        {
            return (Builder) super.setRepeatedField(field, index, value);
        }

        @Override
        public Builder addRepeatedField(
                com.google.protobuf.Descriptors.FieldDescriptor field,
                Object value)
        {
            return (Builder) super.addRepeatedField(field, value);
        }

        @Override
        public Builder mergeFrom(com.google.protobuf.Message other)
        {
            if (other instanceof Header)
            {
                return mergeFrom((Header) other);
            } else
            {
                super.mergeFrom(other);
                return this;
            }
        }

        public Builder mergeFrom(Header other)
        {
            if (other == Header.getDefaultInstance()) return this;
            if (!other.getLogfileName().isEmpty())
            {
                logfileName_ = other.logfileName_;
                onChanged();
            }
            if (other.getLogfileOffset() != 0L)
            {
                setLogfileOffset(other.getLogfileOffset());
            }
            if (other.getServerId() != 0L)
            {
                setServerId(other.getServerId());
            }
            if (!other.getServerenCode().isEmpty())
            {
                serverenCode_ = other.serverenCode_;
                onChanged();
            }
            if (other.getExecuteTime() != 0L)
            {
                setExecuteTime(other.getExecuteTime());
            }
            if (!other.getSchemaName().isEmpty())
            {
                schemaName_ = other.schemaName_;
                onChanged();
            }
            if (!other.getTableName().isEmpty())
            {
                tableName_ = other.tableName_;
                onChanged();
            }
            if (other.getEventLength() != 0L)
            {
                setEventLength(other.getEventLength());
            }
            if (propsBuilder_ == null)
            {
                if (!other.props_.isEmpty())
                {
                    if (props_.isEmpty())
                    {
                        props_ = other.props_;
                        bitField0_ = (bitField0_ & ~0x00000800);
                    } else
                    {
                        ensurePropsIsMutable();
                        props_.addAll(other.props_);
                    }
                    onChanged();
                }
            } else
            {
                if (!other.props_.isEmpty())
                {
                    if (propsBuilder_.isEmpty())
                    {
                        propsBuilder_.dispose();
                        propsBuilder_ = null;
                        props_ = other.props_;
                        bitField0_ = (bitField0_ & ~0x00000800);
                        propsBuilder_ =
                                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                                        getPropsFieldBuilder() : null;
                    } else
                    {
                        propsBuilder_.addAllMessages(other.props_);
                    }
                }
            }
            if (!other.getGtid().isEmpty())
            {
                gtid_ = other.gtid_;
                onChanged();
            }
            switch (other.getVersionPresentCase())
            {
                case VERSION:
                {
                    setVersion(other.getVersion());
                    break;
                }
                case VERSIONPRESENT_NOT_SET:
                {
                    break;
                }
            }
            switch (other.getSourceTypePresentCase())
            {
                case SOURCETYPE:
                {
                    setSourceTypeValue(other.getSourceTypeValue());
                    break;
                }
                case SOURCETYPEPRESENT_NOT_SET:
                {
                    break;
                }
            }
            switch (other.getEventTypePresentCase())
            {
                case EVENTTYPE:
                {
                    setEventTypeValue(other.getEventTypeValue());
                    break;
                }
                case EVENTTYPEPRESENT_NOT_SET:
                {
                    break;
                }
            }
            this.mergeUnknownFields(other.unknownFields);
            onChanged();
            return this;
        }

        @Override
        public final boolean isInitialized()
        {
            return true;
        }

        @Override
        public Builder mergeFrom(
                com.google.protobuf.CodedInputStream input,
                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                throws java.io.IOException
        {
            Header parsedMessage = null;
            try
            {
                parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e)
            {
                parsedMessage = (Header) e.getUnfinishedMessage();
                throw e.unwrapIOException();
            } finally
            {
                if (parsedMessage != null)
                {
                    mergeFrom(parsedMessage);
                }
            }
            return this;
        }

        public VersionPresentCase
        getVersionPresentCase()
        {
            return VersionPresentCase.forNumber(
                    versionPresentCase_);
        }

        public Builder clearVersionPresent()
        {
            versionPresentCase_ = 0;
            versionPresent_ = null;
            onChanged();
            return this;
        }

        public SourceTypePresentCase
        getSourceTypePresentCase()
        {
            return SourceTypePresentCase.forNumber(
                    sourceTypePresentCase_);
        }

        public Builder clearSourceTypePresent()
        {
            sourceTypePresentCase_ = 0;
            sourceTypePresent_ = null;
            onChanged();
            return this;
        }

        public EventTypePresentCase
        getEventTypePresentCase()
        {
            return EventTypePresentCase.forNumber(
                    eventTypePresentCase_);
        }

        public Builder clearEventTypePresent()
        {
            eventTypePresentCase_ = 0;
            eventTypePresent_ = null;
            onChanged();
            return this;
        }

        /**
         * <code>int32 version = 1;</code>
         */
        public int getVersion()
        {
            if (versionPresentCase_ == 1)
            {
                return (Integer) versionPresent_;
            }
            return 0;
        }

        /**
         * <code>int32 version = 1;</code>
         */
        public Builder setVersion(int value)
        {
            versionPresentCase_ = 1;
            versionPresent_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>int32 version = 1;</code>
         */
        public Builder clearVersion()
        {
            if (versionPresentCase_ == 1)
            {
                versionPresentCase_ = 0;
                versionPresent_ = null;
                onChanged();
            }
            return this;
        }

        /**
         * <pre>
         * *binlog/redolog 文件名*
         * </pre>
         * <p>
         * <code>string logfileName = 2;</code>
         */
        public String getLogfileName()
        {
            Object ref = logfileName_;
            if (!(ref instanceof String))
            {
                com.google.protobuf.ByteString bs =
                        (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                logfileName_ = s;
                return s;
            } else
            {
                return (String) ref;
            }
        }

        /**
         * <pre>
         * *binlog/redolog 文件名*
         * </pre>
         * <p>
         * <code>string logfileName = 2;</code>
         */
        public Builder setLogfileName(
                String value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }

            logfileName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *binlog/redolog 文件名*
         * </pre>
         * <p>
         * <code>string logfileName = 2;</code>
         */
        public com.google.protobuf.ByteString
        getLogfileNameBytes()
        {
            Object ref = logfileName_;
            if (ref instanceof String)
            {
                com.google.protobuf.ByteString b =
                        com.google.protobuf.ByteString.copyFromUtf8(
                                (String) ref);
                logfileName_ = b;
                return b;
            } else
            {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <pre>
         * *binlog/redolog 文件名*
         * </pre>
         * <p>
         * <code>string logfileName = 2;</code>
         */
        public Builder setLogfileNameBytes(
                com.google.protobuf.ByteString value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            logfileName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *binlog/redolog 文件名*
         * </pre>
         * <p>
         * <code>string logfileName = 2;</code>
         */
        public Builder clearLogfileName()
        {

            logfileName_ = getDefaultInstance().getLogfileName();
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *binlog/redolog 文件的偏移位置*
         * </pre>
         * <p>
         * <code>int64 logfileOffset = 3;</code>
         */
        public long getLogfileOffset()
        {
            return logfileOffset_;
        }

        /**
         * <pre>
         * *binlog/redolog 文件的偏移位置*
         * </pre>
         * <p>
         * <code>int64 logfileOffset = 3;</code>
         */
        public Builder setLogfileOffset(long value)
        {

            logfileOffset_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *binlog/redolog 文件的偏移位置*
         * </pre>
         * <p>
         * <code>int64 logfileOffset = 3;</code>
         */
        public Builder clearLogfileOffset()
        {

            logfileOffset_ = 0L;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *服务端serverId*
         * </pre>
         * <p>
         * <code>int64 serverId = 4;</code>
         */
        public long getServerId()
        {
            return serverId_;
        }

        /**
         * <pre>
         * *服务端serverId*
         * </pre>
         * <p>
         * <code>int64 serverId = 4;</code>
         */
        public Builder setServerId(long value)
        {

            serverId_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *服务端serverId*
         * </pre>
         * <p>
         * <code>int64 serverId = 4;</code>
         */
        public Builder clearServerId()
        {

            serverId_ = 0L;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * * 变更数据的编码 *
         * </pre>
         * <p>
         * <code>string serverenCode = 5;</code>
         */
        public String getServerenCode()
        {
            Object ref = serverenCode_;
            if (!(ref instanceof String))
            {
                com.google.protobuf.ByteString bs =
                        (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                serverenCode_ = s;
                return s;
            } else
            {
                return (String) ref;
            }
        }

        /**
         * <pre>
         * * 变更数据的编码 *
         * </pre>
         * <p>
         * <code>string serverenCode = 5;</code>
         */
        public Builder setServerenCode(
                String value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }

            serverenCode_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * * 变更数据的编码 *
         * </pre>
         * <p>
         * <code>string serverenCode = 5;</code>
         */
        public com.google.protobuf.ByteString
        getServerenCodeBytes()
        {
            Object ref = serverenCode_;
            if (ref instanceof String)
            {
                com.google.protobuf.ByteString b =
                        com.google.protobuf.ByteString.copyFromUtf8(
                                (String) ref);
                serverenCode_ = b;
                return b;
            } else
            {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <pre>
         * * 变更数据的编码 *
         * </pre>
         * <p>
         * <code>string serverenCode = 5;</code>
         */
        public Builder setServerenCodeBytes(
                com.google.protobuf.ByteString value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            serverenCode_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * * 变更数据的编码 *
         * </pre>
         * <p>
         * <code>string serverenCode = 5;</code>
         */
        public Builder clearServerenCode()
        {

            serverenCode_ = getDefaultInstance().getServerenCode();
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *变更数据的执行时间 *
         * </pre>
         * <p>
         * <code>int64 executeTime = 6;</code>
         */
        public long getExecuteTime()
        {
            return executeTime_;
        }

        /**
         * <pre>
         * *变更数据的执行时间 *
         * </pre>
         * <p>
         * <code>int64 executeTime = 6;</code>
         */
        public Builder setExecuteTime(long value)
        {

            executeTime_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *变更数据的执行时间 *
         * </pre>
         * <p>
         * <code>int64 executeTime = 6;</code>
         */
        public Builder clearExecuteTime()
        {

            executeTime_ = 0L;
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
         */
        public int getSourceTypeValue()
        {
            if (sourceTypePresentCase_ == 7)
            {
                return ((Integer) sourceTypePresent_).intValue();
            }
            return Type.MYSQL_VALUE;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
         */
        public Builder setSourceTypeValue(int value)
        {
            sourceTypePresentCase_ = 7;
            sourceTypePresent_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
         */
        public Type getSourceType()
        {
            if (sourceTypePresentCase_ == 7)
            {
                @SuppressWarnings("deprecation")
                Type result = Type.valueOf(
                        (Integer) sourceTypePresent_);
                return result == null ? Type.UNRECOGNIZED : result;
            }
            return Type.TYPECOMPATIBLEPROTO2;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
         */
        public Builder setSourceType(Type value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            sourceTypePresentCase_ = 7;
            sourceTypePresent_ = value.getNumber();
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.Type sourceType = 7;</code>
         */
        public Builder clearSourceType()
        {
            if (sourceTypePresentCase_ == 7)
            {
                sourceTypePresentCase_ = 0;
                sourceTypePresent_ = null;
                onChanged();
            }
            return this;
        }

        /**
         * <pre>
         * * 变更数据的schemaname*
         * </pre>
         * <p>
         * <code>string schemaName = 8;</code>
         */
        public String getSchemaName()
        {
            Object ref = schemaName_;
            if (!(ref instanceof String))
            {
                com.google.protobuf.ByteString bs =
                        (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                schemaName_ = s;
                return s;
            } else
            {
                return (String) ref;
            }
        }

        /**
         * <pre>
         * * 变更数据的schemaname*
         * </pre>
         * <p>
         * <code>string schemaName = 8;</code>
         */
        public Builder setSchemaName(
                String value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }

            schemaName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * * 变更数据的schemaname*
         * </pre>
         * <p>
         * <code>string schemaName = 8;</code>
         */
        public com.google.protobuf.ByteString
        getSchemaNameBytes()
        {
            Object ref = schemaName_;
            if (ref instanceof String)
            {
                com.google.protobuf.ByteString b =
                        com.google.protobuf.ByteString.copyFromUtf8(
                                (String) ref);
                schemaName_ = b;
                return b;
            } else
            {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <pre>
         * * 变更数据的schemaname*
         * </pre>
         * <p>
         * <code>string schemaName = 8;</code>
         */
        public Builder setSchemaNameBytes(
                com.google.protobuf.ByteString value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            schemaName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * * 变更数据的schemaname*
         * </pre>
         * <p>
         * <code>string schemaName = 8;</code>
         */
        public Builder clearSchemaName()
        {

            schemaName_ = getDefaultInstance().getSchemaName();
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *变更数据的tablename*
         * </pre>
         * <p>
         * <code>string tableName = 9;</code>
         */
        public String getTableName()
        {
            Object ref = tableName_;
            if (!(ref instanceof String))
            {
                com.google.protobuf.ByteString bs =
                        (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                tableName_ = s;
                return s;
            } else
            {
                return (String) ref;
            }
        }

        /**
         * <pre>
         * *变更数据的tablename*
         * </pre>
         * <p>
         * <code>string tableName = 9;</code>
         */
        public Builder setTableName(
                String value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }

            tableName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *变更数据的tablename*
         * </pre>
         * <p>
         * <code>string tableName = 9;</code>
         */
        public com.google.protobuf.ByteString
        getTableNameBytes()
        {
            Object ref = tableName_;
            if (ref instanceof String)
            {
                com.google.protobuf.ByteString b =
                        com.google.protobuf.ByteString.copyFromUtf8(
                                (String) ref);
                tableName_ = b;
                return b;
            } else
            {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <pre>
         * *变更数据的tablename*
         * </pre>
         * <p>
         * <code>string tableName = 9;</code>
         */
        public Builder setTableNameBytes(
                com.google.protobuf.ByteString value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            tableName_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *变更数据的tablename*
         * </pre>
         * <p>
         * <code>string tableName = 9;</code>
         */
        public Builder clearTableName()
        {

            tableName_ = getDefaultInstance().getTableName();
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *每个event的长度*
         * </pre>
         * <p>
         * <code>int64 eventLength = 10;</code>
         */
        public long getEventLength()
        {
            return eventLength_;
        }

        /**
         * <pre>
         * *每个event的长度*
         * </pre>
         * <p>
         * <code>int64 eventLength = 10;</code>
         */
        public Builder setEventLength(long value)
        {

            eventLength_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *每个event的长度*
         * </pre>
         * <p>
         * <code>int64 eventLength = 10;</code>
         */
        public Builder clearEventLength()
        {

            eventLength_ = 0L;
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
         */
        public int getEventTypeValue()
        {
            if (eventTypePresentCase_ == 11)
            {
                return ((Integer) eventTypePresent_).intValue();
            }
            return EventType.UPDATE_VALUE;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
         */
        public Builder setEventTypeValue(int value)
        {
            eventTypePresentCase_ = 11;
            eventTypePresent_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
         */
        public EventType getEventType()
        {
            if (eventTypePresentCase_ == 11)
            {
                @SuppressWarnings("deprecation")
                EventType result = EventType.valueOf(
                        (Integer) eventTypePresent_);
                return result == null ? EventType.UNRECOGNIZED : result;
            }
            return EventType.EVENTTYPECOMPATIBLEPROTO2;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
         */
        public Builder setEventType(EventType value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            eventTypePresentCase_ = 11;
            eventTypePresent_ = value.getNumber();
            onChanged();
            return this;
        }

        /**
         * <code>.com.alibaba.otter.canal.protocol.EventType eventType = 11;</code>
         */
        public Builder clearEventType()
        {
            if (eventTypePresentCase_ == 11)
            {
                eventTypePresentCase_ = 0;
                eventTypePresent_ = null;
                onChanged();
            }
            return this;
        }

        private void ensurePropsIsMutable()
        {
            if (!((bitField0_ & 0x00000800) == 0x00000800))
            {
                props_ = new java.util.ArrayList<Pair>(props_);
                bitField0_ |= 0x00000800;
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public java.util.List<Pair> getPropsList()
        {
            if (propsBuilder_ == null)
            {
                return java.util.Collections.unmodifiableList(props_);
            } else
            {
                return propsBuilder_.getMessageList();
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public int getPropsCount()
        {
            if (propsBuilder_ == null)
            {
                return props_.size();
            } else
            {
                return propsBuilder_.getCount();
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Pair getProps(int index)
        {
            if (propsBuilder_ == null)
            {
                return props_.get(index);
            } else
            {
                return propsBuilder_.getMessage(index);
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder setProps(
                int index, Pair value)
        {
            if (propsBuilder_ == null)
            {
                if (value == null)
                {
                    throw new NullPointerException();
                }
                ensurePropsIsMutable();
                props_.set(index, value);
                onChanged();
            } else
            {
                propsBuilder_.setMessage(index, value);
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder setProps(
                int index, Pair.Builder builderForValue)
        {
            if (propsBuilder_ == null)
            {
                ensurePropsIsMutable();
                props_.set(index, builderForValue.build());
                onChanged();
            } else
            {
                propsBuilder_.setMessage(index, builderForValue.build());
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder addProps(Pair value)
        {
            if (propsBuilder_ == null)
            {
                if (value == null)
                {
                    throw new NullPointerException();
                }
                ensurePropsIsMutable();
                props_.add(value);
                onChanged();
            } else
            {
                propsBuilder_.addMessage(value);
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder addProps(
                int index, Pair value)
        {
            if (propsBuilder_ == null)
            {
                if (value == null)
                {
                    throw new NullPointerException();
                }
                ensurePropsIsMutable();
                props_.add(index, value);
                onChanged();
            } else
            {
                propsBuilder_.addMessage(index, value);
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder addProps(
                Pair.Builder builderForValue)
        {
            if (propsBuilder_ == null)
            {
                ensurePropsIsMutable();
                props_.add(builderForValue.build());
                onChanged();
            } else
            {
                propsBuilder_.addMessage(builderForValue.build());
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder addProps(
                int index, Pair.Builder builderForValue)
        {
            if (propsBuilder_ == null)
            {
                ensurePropsIsMutable();
                props_.add(index, builderForValue.build());
                onChanged();
            } else
            {
                propsBuilder_.addMessage(index, builderForValue.build());
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder addAllProps(
                Iterable<? extends Pair> values)
        {
            if (propsBuilder_ == null)
            {
                ensurePropsIsMutable();
                com.google.protobuf.AbstractMessageLite.Builder.addAll(
                        values, props_);
                onChanged();
            } else
            {
                propsBuilder_.addAllMessages(values);
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder clearProps()
        {
            if (propsBuilder_ == null)
            {
                props_ = java.util.Collections.emptyList();
                bitField0_ = (bitField0_ & ~0x00000800);
                onChanged();
            } else
            {
                propsBuilder_.clear();
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Builder removeProps(int index)
        {
            if (propsBuilder_ == null)
            {
                ensurePropsIsMutable();
                props_.remove(index);
                onChanged();
            } else
            {
                propsBuilder_.remove(index);
            }
            return this;
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Pair.Builder getPropsBuilder(
                int index)
        {
            return getPropsFieldBuilder().getBuilder(index);
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public PairOrBuilder getPropsOrBuilder(
                int index)
        {
            if (propsBuilder_ == null)
            {
                return props_.get(index);
            } else
            {
                return propsBuilder_.getMessageOrBuilder(index);
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public java.util.List<? extends PairOrBuilder>
        getPropsOrBuilderList()
        {
            if (propsBuilder_ != null)
            {
                return propsBuilder_.getMessageOrBuilderList();
            } else
            {
                return java.util.Collections.unmodifiableList(props_);
            }
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Pair.Builder addPropsBuilder()
        {
            return getPropsFieldBuilder().addBuilder(
                    Pair.getDefaultInstance());
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public Pair.Builder addPropsBuilder(
                int index)
        {
            return getPropsFieldBuilder().addBuilder(
                    index, Pair.getDefaultInstance());
        }

        /**
         * <pre>
         * *预留扩展*
         * </pre>
         * <p>
         * <code>repeated .com.alibaba.otter.canal.protocol.Pair props = 12;</code>
         */
        public java.util.List<Pair.Builder>
        getPropsBuilderList()
        {
            return getPropsFieldBuilder().getBuilderList();
        }

        private com.google.protobuf.RepeatedFieldBuilderV3<
                Pair, Pair.Builder, PairOrBuilder>
        getPropsFieldBuilder()
        {
            if (propsBuilder_ == null)
            {
                propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
                        Pair, Pair.Builder, PairOrBuilder>(
                        props_,
                        ((bitField0_ & 0x00000800) == 0x00000800),
                        getParentForChildren(),
                        isClean());
                props_ = null;
            }
            return propsBuilder_;
        }

        /**
         * <pre>
         * *当前事务的gitd*
         * </pre>
         * <p>
         * <code>string gtid = 13;</code>
         */
        public String getGtid()
        {
            Object ref = gtid_;
            if (!(ref instanceof String))
            {
                com.google.protobuf.ByteString bs =
                        (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                gtid_ = s;
                return s;
            } else
            {
                return (String) ref;
            }
        }

        /**
         * <pre>
         * *当前事务的gitd*
         * </pre>
         * <p>
         * <code>string gtid = 13;</code>
         */
        public Builder setGtid(
                String value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }

            gtid_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *当前事务的gitd*
         * </pre>
         * <p>
         * <code>string gtid = 13;</code>
         */
        public com.google.protobuf.ByteString
        getGtidBytes()
        {
            Object ref = gtid_;
            if (ref instanceof String)
            {
                com.google.protobuf.ByteString b =
                        com.google.protobuf.ByteString.copyFromUtf8(
                                (String) ref);
                gtid_ = b;
                return b;
            } else
            {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <pre>
         * *当前事务的gitd*
         * </pre>
         * <p>
         * <code>string gtid = 13;</code>
         */
        public Builder setGtidBytes(
                com.google.protobuf.ByteString value)
        {
            if (value == null)
            {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            gtid_ = value;
            onChanged();
            return this;
        }

        /**
         * <pre>
         * *当前事务的gitd*
         * </pre>
         * <p>
         * <code>string gtid = 13;</code>
         */
        public Builder clearGtid()
        {

            gtid_ = getDefaultInstance().getGtid();
            onChanged();
            return this;
        }

        @Override
        public final Builder setUnknownFields(
                final com.google.protobuf.UnknownFieldSet unknownFields)
        {
            return super.setUnknownFieldsProto3(unknownFields);
        }

        @Override
        public final Builder mergeUnknownFields(
                final com.google.protobuf.UnknownFieldSet unknownFields)
        {
            return super.mergeUnknownFields(unknownFields);
        }


        // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Header)
    }

}
